import Vue from "vue";

const contexts = require.context(".", false, /\.js$/);
contexts.keys().forEach(component => {
  let filters = contexts(component);
  for (let key in filters) {
    let filter = filters[key];
    // 使用内置的过滤器名称（函数名称） 进行全局过滤器注册
    console.log(filter.name);
    Vue.filter(filter.name, filter);
  }
});
